 #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdlib>
#include<cmath>
#include<sstream>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<stack>
using namespace std;
typedef long long LL;
const int maxn=105;
const int mod=1000000007;
LL c[maxn][maxn],dp[10][maxn];//dp[i][j] means the combinations with length = j and end with i 
int main(){
	for(int i=0;i<=100;i++){
		c[i][0]=c[i][i]=1;
		for(int j=1;j<i;j++)c[i][j]=(c[i-1][j]+c[i-1][j-1])%mod;
		}
	
	int n,num[10],tot;
	while(cin>>n){
		tot=0;
		for(int i=0;i<=9;i++)cin>>num[i],tot+=num[i];
		memset(dp,0,sizeof(dp));
		for(int i=num[9];i<=n;i++)dp[9][i]=1;
		
		for(int i=8;i>=0;i--){
			for(int j=num[i];j<=n;j++){
				for(int k=0;k+j<=n;k++){
					dp[i][k+j]=(dp[i][k+j]+dp[i+1][k]*c[k+j-(i?0:1)][j]%mod)%mod;
					}
				}
			}
		LL ans=0;
		for(int i=max(tot,1);i<=n;i++)ans=(ans+dp[0][i])%mod;
		cout<<ans<<endl; 
		}
    return 0;
    }
